// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) definits fieldsfirst ansi space safe 
// Source File Name:   TestSimulation.java

package jones;

import java.util.Iterator;
import java.util.List;
import jones.behavior.Behavior;
import jones.behavior.SimplePriorityListArbiter;
import jones.rigid.RigidBody;

// Referenced classes of package jones:
//            SimpleSimulation, Light, SimpleRobot, Wall, 
//            HockeyPuck, Simulation, World

public class TestSimulation extends SimpleSimulation
    implements Simulation
{

    private static final String NAME = "*Test*";

    public TestSimulation()
    {
        initSimulation();
    }

    public TestSimulation(TestSimulation simulation)
    {
        for (Iterator i = simulation.lights.iterator(); i.hasNext(); lights.add(((Object) (new Light((Light)i.next())))));
        for (Iterator i = simulation.robots.iterator(); i.hasNext(); robots.add(((Object) (new SimpleRobot((SimpleRobot)i.next(), world)))));
        for (Iterator i = simulation.rigidBodies.iterator(); i.hasNext();)
        {
            RigidBody rigidBody = (RigidBody)i.next();
            if (rigidBody instanceof Wall)
                rigidBodies.add(((Object) (new Wall((Wall)rigidBody))));
            else
            if (rigidBody instanceof HockeyPuck)
                rigidBodies.add(((Object) (new HockeyPuck((HockeyPuck)rigidBody))));
        }

        super.initRigidBodies();
        super.initSimObjects();
        super.initObservables();
        super.initWorld();
        super.initSimulator();
        world.setLatency(simulation.world.getLatency());
        world.setFantasyMode(simulation.world.isFantasyMode());
    }

    protected void initRobots()
    {
        SimpleRobot robot = new SimpleRobot(100D, 100D, 0.0D, world);
        robot.setVelocity(0.0D, 50D);
        robot.setAngularVelocity(0.5D);
        robot.setAxis(0.0D, 0.0D);
        robot.setBehaviors(new Behavior[0]);
        robot.setArbiter(((jones.behavior.Arbiter) (new SimplePriorityListArbiter(((SimpleRobotInterface) (robot)), new Behavior[0]))));
        robots.add(((Object) (robot)));
    }

    public String getName()
    {
        return "*Test*";
    }

    public Simulation copySimulation()
    {
        return ((Simulation) (new TestSimulation(this)));
    }

    public Simulation createNewSimulation()
    {
        return ((Simulation) (new TestSimulation()));
    }
}
